package com.wust.db;

/**
 * Created by lenovo on 2018/6/3.
 */
public class HandleDataSource {
    public static final ThreadLocal<String> holder = new ThreadLocal<String>();

    /**
     * 绑定当前线程数据源路由
     *
     * @param datasource
     */
    public static void putDataSource(String datasource) {
        holder.set(datasource);
    }

    /**
     * 获取当前线程的数据源路由
     *
     * @return
     */
    public static String getDataSource() {
        return holder.get();
    }
}